package com.shd.edanpei.ui.view;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

import com.shd.edanpei.R;
import com.shd.edanpei.bean.ImgInfoBean;
import com.shd.edanpei.common.Constant;
import com.shd.edanpei.ui.activity.FileListActivity;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by mc on 2018/9/20.
 * 查看上传文件
 */

@SuppressLint("ViewConstructor")
public class FilePersonalDataView extends LinearLayout {

    private Unbinder mUnbinder;
    private ImgInfoBean model;
    private Bundle bundle;
    private Intent intent;

    public FilePersonalDataView(Context context, ImgInfoBean model) {
        super(context);
        this.model = model;
        initView();
    }


    private void initView() {
        LayoutInflater.from(getContext()).inflate(R.layout.file_data_view, this);
        mUnbinder = ButterKnife.bind(this);

        setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                bundle = new Bundle();
                bundle.putInt(Constant.TYPE, Constant.SHOW);
                bundle.putInt(Constant.ORDER_TYPE, 4);
                bundle.putParcelable(Constant.DATA, model);
                intent = new Intent(getContext(), FileListActivity.class);
                intent.putExtras(bundle);
                getContext().startActivity(intent);
            }
        });


    }
}
